home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / graphics / qpeg11c.zip / DELLS3.ASM < prev    next >
Assembly Source File  |  1993-11-04  |  2KB  |  84 lines

  1. ;
  2. ; QPEG video driver
  3. ; for S3 86c805 chipsets (DELL Local Bus)
  4. ; Tested on DELL 433/T. Other S3 cards may require additional code in init.
  5. ;
  6. ; Lenny Lim, 1993
  7. ;
  8. ; Note:  If you can't get it to work, try the VESA configuration.
  9. ;
  10.  
  11.         .286
  12. Code    Segment Para 'Code'
  13.         Assume  cs:Code
  14.         Org 100h
  15.  
  16. Procs   dw      Bank,Init,Exit,0
  17.  
  18. plan16  db      0               ; stores 1 for planar 16 color mode
  19.  
  20. Bank:   cmp     plan16,2
  21.         jne     svga
  22.         retf
  23. svga:
  24.         mov     dx, 3d4h        ; Enable extended registers
  25.         push    ax
  26.         mov     al, 38h
  27.         out     dx, al
  28.         inc     dx
  29.         mov     al, 48h
  30.         out     dx, al
  31.  
  32.         dec     dx              ; Enable write to bank registers
  33.         mov     al, 31h
  34.         out     dx, al
  35.         inc     dx
  36.         mov     al, 89h
  37.         in      al, dx
  38.         push    ax
  39.         dec     dx
  40.         mov     al, 31h
  41.         out     dx, al
  42.         inc     dx
  43.         pop     ax
  44.         or      al, 9
  45.         out     dx, al
  46.  
  47.         dec     dx              ; Switch banks
  48.         mov     al, 35h
  49.         out     dx, al
  50.         inc     dx
  51.         pop     ax
  52.         cmp     cs:plan16, 1
  53.         jne     col256
  54.         shl     al, 2
  55. col256:
  56.         out     dx, al
  57.  
  58.         dec     dx              ; Disable extended registers
  59.         mov     al, 38h
  60.         out     dx, al
  61.         inc     dx
  62.         mov     al, 0
  63.         out     dx, al
  64.  
  65.         retf
  66.  
  67. Init:   cmp     al, 13h
  68.         jg      svgainit
  69.         mov     cs:plan16, 2
  70.         retf
  71.  
  72. svgainit:
  73.         and     al, 1
  74.         xor     al, 1
  75.         mov     cs:plan16, al
  76.         retf
  77.  
  78. Exit:   retf
  79.  
  80. Code    Ends
  81.         End Procs
  82.  
  83. ; End of source.
  84.